Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Functor tupleLeft and tupleRight #1468

Merged
merged 1 commit into from
Dec 22, 2016

Conversation

edmundnoble
Copy link
Contributor

strengthL and strengthR for Functors. Tuple regular values with effectful ones.

@codecov-io
Copy link

codecov-io commented Nov 16, 2016

Current coverage is 92.23% (diff: 100%)

Merging #1468 into master will increase coverage by <.01%

@@             master      #1468   diff @@
==========================================
  Files           242        242          
  Lines          3619       3621     +2   
  Methods        3549       3553     +4   
  Messages          0          0          
  Branches         70         68     -2   
==========================================
+ Hits           3338       3340     +2   
  Misses          281        281          
  Partials          0          0          

Powered by Codecov. Last update e20cb6b...6068406

@adelbertc
Copy link
Contributor

👍

@peterneyens
Copy link
Collaborator

I have been thinking about adding these myself, but I wonder if we can't come up with some easier names (even though that's what they are called in scalaz and there seems to be a strength function in Haskell as well). Maybe something like tupleLeft / tupleRight ?

If nobody shares my concern, I am fine adding these as they stand.

@edmundnoble
Copy link
Contributor Author

@peterneyens I am inclined to agree, but I don't at all feel strongly.

@johnynek
Copy link
Contributor

.tuple for F[A], B to F[(A, B)] and .tupleSwap for the the other variant
would be my naming instinct, but I like non-insider names geared at
discoverability and and ease of remembering.
On Thu, Nov 17, 2016 at 21:25 Edmund Noble notifications@github.com wrote:

@peterneyens https://github.com/peterneyens I am inclined to agree, but
I don't at all feel strongly.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#1468 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAEJdkujwKTaEDIl6_HmBjmGajI3uui9ks5q_VLugaJpZM4K0i7t
.

@adelbertc
Copy link
Contributor

Since we have Cartesian#product maybe productLeft and productRight ?

Add tests

tupleRight/tupleLeft
@edmundnoble
Copy link
Contributor Author

I've switched it around to tupleLeft and tupleRight, just because I don't think presuming an order of tupling is intuitive @johnynek and I don't want to confuse this with Cartesian ops because this requires Functor @adelbertc. I hope this is agreeable.

@edmundnoble edmundnoble changed the title Functor strengthL and strengthR Functor tupleLeft and tupleRight Nov 19, 2016
Copy link
Collaborator

@peterneyens peterneyens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@johnynek
Copy link
Contributor

👍

@johnynek johnynek merged commit 974b840 into typelevel:master Dec 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants